package pages;

import core.TestBase;
import org.openqa.selenium.By;
import utils.Log4Test;
/**
 * Created by Nicktoris on 22.07.2014.
 */
public class RozaetkaHomePage extends TestBase
{
    private String url = "http://rozetka.com.ua/";
    protected By linkForNoteBooks =By.xpath("//ul[@class='main-page-m-catalog-subl']//a[@href='http://rozetka.com.ua/notebooks/c80004/']");

    public void open()
    {
        webDriver.get(url);
        Log4Test.info("Opening the web adress...->  " + url);
    }

    public void openNotebooksSection()
    {
        Log4Test.info("Opening the section where all notebooks are displayed... ");
        targetElement = webDriver.findElement(linkForNoteBooks);
        if (targetElement.isEnabled())
        {
            targetElement.click();
        }

    }

    public boolean pageIsOpened()
    {
        return webDriver.getCurrentUrl().equals(url);
    }

}
